<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        /* 
            ()：括号里的内容会被当作整体进行匹配
         */

         const rg = /^(abc){2}$/        //abc  作为一个整体出现2次
         console.log(rg.test("abc"))        //false
         console.log(rg.test("abcabc"))     //true
         console.log(rg.test("abca"))       //false
         console.log(rg.test("abcdd"))      //false
         console.log(rg.test("abcabcabc"))  //false
    </script>
</body>
</html>